﻿@{
    ViewBag.Title = "MemberTransfer";
    Layout = "~/Views/Shared/_LayoutMember.cshtml";
    var Member = Session["LoginUser"] as Domain.Model.User;
}
@model Domain.Model.Transfer

@section HeadScript
{
    <link href="~/Content/window/window.css" rel="stylesheet" />
    <script src="~/Content/window/window.js"></script>
    <link href="~/Content/validBox/validBox.css" rel="stylesheet" />
    <script src="~/Content/validBox/validBox.js"></script>
}
<div class="fr2 green fs-25 Tbrline">会员转账</div>
<div class="fr2">
<div class="alert alert-info">
    <p>电子币钱包：@Member.ElectronicToken</p>
    <p>报单币钱包：@Member.DeclarationToken</p>
    </div>
    <form class="form-horizontal">
        <div class="control-group">
            <label class="control-label" for="Name">转账类型</label>
            <div class="controls" >
                <select id="ddlType">
                    <option>电子币钱包</option>
                    <option>报单币钱包</option>
                </select>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="Name">转账金额</label>
            <div class="controls">
                @Html.TextBoxFor(i => i.Amount,Html.ValueFor(i=>i.Amount))
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="Name">接受会员账号</label>
            <div class="controls">
                @Html.TextBoxFor(i => i.UserIn, Html.ValidFor(i => i.UserIn))
            </div>
        </div>

        <div class="control-group">
            <label class="control-label"></label>
            <div class="controls">
                <input type="button" value="提  交" class="sbtn" onclick="saveForm()" />
            </div>
        </div>
    </form>
</div>


@section Script
{
    <script type="text/javascript">
        function saveForm() {
            $("form").validBox(function (r) {
                if (!r) return;
                $.post("/member/MemberTransfer", {
                    type: $("#ddlType").val(),
                    Amount: $("#Amount").val(),
                    UserIn: $("#UserIn").val()
                }, function (data) {
                    if (data.state) {
                        $("#Amount").val("");
                        $("#UserIn").val("");

                        window.messageBox("系统提示", data.value)
                    }
                    else {
                        window.messageBox("系统提示",data.value);
                    }
                });
            });
        }
    </script>
}

